<!doctype html>
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title>交通1033</title>
<script type="text/javascript" src="js/isflash.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="js/utils.js" type="text/javascript"></script>
<script type="text/javascript" src="flowmedia/flowplayer-3.2.13.min.js"></script>
<script type="text/javascript">
var paramStr=location.search;
var _shopId;
var _openId;
	$(function() {
		_openId = getWxParameter("openId",paramStr);
		_shopId = getWxParameter("shopId",paramStr);
		initRtmp('audio', 'rtmp://61.139.126.154/live/jtgb'); //初始化直播
		$(".wrapper").height($(document).height());
		//弹出层
		addMargin($(".hideDiv"));	
		$(".orderBtn .pay").click(function(){
			$(".window1,.shade1").show();	
		})
		addMargin($(".hideDiv"));
	});
	//initRtmp('audio', 'rtmp://61.139.126.154/live/yygb');
	function initRtmp(handler, rtmp) {
		$f(handler, "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf",
		{
			clip : {
				url : rtmp,
				live : true,
				provider : 'rtmp'
			},

			plugins : {
				rtmp : {
					url : "flowplayer.rtmp-3.2.13.swf",
				},
				controls : {
					autoHide : false,
					AutoHiding : false,
					volume : true,
					fullscreen : false, //全屏
					mute : true, //喇叭
					time : false,
					fastForward : false,
					slowForward : false,
					scrubber : false,
					tooltips : null
				}
			}
		});
	}
	
	function insertCustIntratn(){
		if(IsNotEmpty(_shopId) && IsNotEmpty(_openId)){
			$.post("../custIntratn/insert/custIntratn/openId/"+_openId, {
				"chanalId" : 3
			}, function(data) {
				if(IsEmpty(data)){
					$("#message").text("互动失败");
					addMargin($(".hideDiv"));
					return;
				}
				if (data.state == 0) {
					addMargin($(".hideDiv"));
				} else {
					$("#message").text("互动失败");
					addMargin($(".hideDiv"));
				}
			},"json"); 
		}
	}
</script>
</head>

<body>
<div class="shade1 shade"></div>
<div class="window1 hideDiv">
	<div class="closeTop"><strong>温馨提醒</strong><span onclick="closeParent($(this))" class="closeThe"><img src="images/close.png"></span></div>
    <p id="message" class="tips">您好！请在微信对话框中发送文字、图片、语音参与&lt;交通1033&gt;频道互动！</p>
    <div class="BottomBtn"><input type="button" value="确认信息" onclick="closeParent($(this))"></div>
</div>
	<div class="wrapper"
		style="background: url(images/online3.jpg) no-repeat center top;">
		<div class="header">
			<h1
				style="margin: 0 auto; width: 78px; height: 48px; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; background: #fff; opacity: 0.8; filter: alpha(opacity = 80);">
				<img src="images/logo.png">
			</h1>
		</div>
		<div class="container">
			<div class="onlinePlay">
				<div class="onplay">正在播放</div>
				<div class="playTit">交通 1033</div>
				<!--  <div class="date">15:00-16:00<span class="turnOff" id="radio_stop"></span><span class="turnOn" id="radio_play"></span></div> -->
			</div>
			<a id="audio" style="display: block; width: 100%; height:25px;">
			</a>
		    <div class="orderBtn"> <a onclick="insertCustIntratn()" class="pay">点击参与微信节目互动</a> </div>
		</div>
		<div class="footer" style="position:absolute;left:0;bottom:0;">©2012-2014阡陌时空信息科技（北京）有限公司</div>
		<!-- <div id="posterList" class="posterList"><span id="turnList" class="turnOn"></span>
    	<div id="mainPeople">
        	<h3 class="title">播放列表</h3>
            <dl>
            	<dt><img src="images/host1.jpg"></dt>
                <dd><strong>姓名：周华</strong><p>直播时间：15：00-16:00</p><p>直播内容：《天下父母》</p></dd>
            </dl>
            <dl>
            	<dt><img src="images/host2.jpg"></dt>
                <dd><strong>姓名：豆豆</strong><p>直播时间：15：00-16:00</p><p>直播内容：《天下父母》</p></dd>
            </dl>
            <dl>
            	<dt><img src="images/host3.jpg"></dt>
                <dd><strong>姓名：李然</strong><p>直播时间：15：00-16:00</p><p>直播内容：《天下父母》</p></dd>
            </dl>
            <dl>
            	<dt><img src="images/host4.jpg"></dt>
                <dd><strong>姓名：小顺</strong><p>直播时间：15：00-16:00</p><p>直播内容：《天下父母》</p></dd>
            </dl>
            <dl>
            	<dt><img src="images/host5.jpg"></dt>
                <dd><strong>姓名：江南</strong><p>直播时间：15：00-16:00</p><p>直播内容：《天下父母》</p></dd>
            </dl>
        </div>
    </div> -->
	</div>
	<!--  <audio id="playinfo" src="http://dload.kandian.com:22111/1043512250.m3u8"></audio>
    <object id="flash" width="0" height="0" style="opacity: 0; position: absolute; z-index: 200;
        left: 0px;" type="application/x-shockwave-flash" data="http://u1.sinaimg.cn/upload/h5/img/radio/MP3Player.swf">
        <param name="movie" value="http://u1.sinaimg.cn/upload/h5/img/radio/MP3Player.swf">
        <param name="allowScriptAccess" value="always">
        <param name="wmode" value="transparent">
        <param name="flashvars" value="dataURL=http%3a%2f%2fcdn.kandian.com%2fmovies%3fcmd%3dplay%26id%3d1043512250%26start%3d1388678401%26end%3d1395040804&volumn=0.5">
    </object> -->
	<script type="text/javascript">
		/* var count = 0;
		var li_name ;
		$(function () {
		    //设置播放列表的高度
		    var h = $(window).height();
		    var realh = h;
		    $("#playlist").css("height", realh + "px");
		    $("#dleft").hide();
		    $("#dright").hide();
		    
		    var list_arrow = $(".list-active");
		    var list_bg = $("#plbg");
		    var list = $("#playlist");
		    //显示隐藏播放列表
		    $("#show_list").toggle(function () {
		        //禁止重复加载播放列表
		        if (!$("#list li:first a div").attr("class")) {
		            loadList(count);
		        }
		        list_arrow.fadeIn(100);
		        list_bg.fadeIn(100);
		        list.fadeIn(200);
		        $("#dleft").show();
		        $("#dright").show();
		    }, function () {
		        count = 0;
		        list_arrow.fadeOut(300);
		        list_bg.fadeOut(300);
		        list.fadeOut(200);
		        $("#dleft").hide();
		        $("#dright").hide();
		    });
		});
		    //加载播放列表
		function dleft() {
		    $("#dright").show();
		    count--;
		    loadList(count);
		    if (count == -2) {
		        $("#dleft").hide();
		        return;
		    }
		}
		function dright() {
		    $("#dleft").show();
		    count++
		    loadList(count);
		    if (count == 2) {
		        $("#dright").hide();
		        return;
		    }
		}

		function loadList(day) {
		    $.ajax({
		        type: "GET",
		        dataType: "json",
		        url: "/hander/PlayList.ashx",
		        data: { "id": day,"sid":18 },
		        beforeSend: function () {
		            $("#list").html('<div class="loadding">节目信息加载中...</div>');
		        },
		        success: function (json) {
		            var l = json.length;
		            if(l==0)
		            {
		                $("#list").html('<div class="loadding">没有数据哦! 亲</div>');
		                return;
		            }
		            var h = "";
		            for (var i = 0; i < l; i++) {
		                var title = json[i].play_name;
		                var author = json[i].anchor_id;
		                var img = json[i].pic;
		                var pid = json[i].id;
		                var btime = json[i].btime;
		                var etime = json[i].etime;
		                h += '<li';
		                if (json[i].flag == '1') {
		                    li_name = 'li_t_'+pid;
		                    h += ' class="jp-playlist-current"><a name ="li_t_'+pid+'" id="li_t_'+pid+'"></a>';
		                }
		                else
		                {
		                    h+='>';
		                }
		                if (json[i].status == '1') {
		                    h += '<a href="javascript:;" onclick="listen_pod(' + pid + ',\''+btime+'\')"  class="jp-playlist-item">';
		                }
		                h += '<div class="item-image">';
		                h += '<img style="width:60px; height:50px;" src="' + img + '" />';
		                h += '</div>';
		                h += '<div class="item-intro">';
		                h += '<h3>' + title + '</h3>';
		                if (json[i].status == '1') {
		                    h += '<div style="background:url(img/play.png);width:18px;height:18px;float:left;"></div>';
		                }
		                h += '<p> ' + btime + '-' + etime + '&nbsp;&nbsp;&nbsp;' + author + '</p>';
		                h += '</div>';
		                if (json[i].status == '1') {
		                    h += '</a>';
		                }
		                h += '</li>';
		            }
		            $("#list").html(h + '<div style="height:75px; width:1px;"></div>');
		        },
		        error: function () {
		            $("#list").html('<div class="loadding">没有数据哦! 亲</div>');
		        }
		    });
		} */
	</script>
	<!-- 判断浏览器 -->
	<script type="text/javascript">
		/* var _flag = 0;
		var browser = {
		    versions: function () {
		        var u = navigator.userAgent, app = navigator.appVersion;
		        return {//移动终端浏览器版本信息
		            trident: u.indexOf('Trident') > -1, //IE内核
		            presto: u.indexOf('Presto') > -1, //opera内核
		            webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
		            gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
		            mobile: !!u.match(/AppleWebKit.*Mobile.) || !!u.match(/AppleWebKit/), //是否为移动终端
		            ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
		            android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
		            iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
		            iPad: u.indexOf('iPad') > -1, //是否iPad
		            webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
		        };
		    } (),
		    language: (navigator.browserLanguage || navigator.language).toLowerCase()
		}
		function initClick(init) {
		    $("#radio_play").unbind("click");
		    $("#radio_stop").unbind("click");
		    if (init == 0) {
		        var a = $("#playinfo")[0];
		        $("#radio_play").show();
		        $("#radio_stop").hide();
		        $("#radio_play").click(function () {
		            a.play();
		            $("#radio_play").hide();
		            $("#radio_stop").show();
		        });
		        $("#radio_stop").click(function () {
		            a.pause();
		            $("#radio_play").show();
		            $("#radio_stop").hide();
		        });
		    }
		    else if (init == 1) {
		        var a = $("#flash")[0];
		        $("#radio_play").hide();
		        $("#radio_stop").show();
		        $("#radio_play").click(function () {
		            a.mplay();
		            $("#radio_play").hide();
		            $("#radio_stop").show();
		        });
		        $("#radio_stop").click(function () {
		            a.mstop();
		            $("#radio_play").show();
		            $("#radio_stop").hide();
		        });
		    }
		    else {
		        var a = $("#jp_audio_0")[0];
		        $("#radio_play").hide();
		        $("#radio_stop").show();
		        $("#radio_play").click(function () {
		            a.play();
		            $("#radio_play").hide();
		            $("#radio_stop").show();
		        });
		        $("#radio_stop").click(function () {
		            a.pause();
		            $("#radio_play").show();
		            $("#radio_stop").hide();
		        });
		    }
		}
		if (browser.versions.iPhone) {
		    initClick(0);
		}
		else {
		    initClick(1);
		} */
	</script>
	<!-- 判断浏览器结束 -->
	<script type="text/javascript">
		/*        function loadData() {
		           $.get("/hander/PlayList.ashx", {"id":"","sid":18},
			                        function (data, status) {
			                            var list = $.parseJSON(data);
			                            if (status == "success") {
			                                var play_name = $("#item_title");
			                                var play_time = $("#item_author");
			                                play_name.html(list.play_name);
			                                play_time.html(list.btime+"-"+list.etime+'&nbsp;&nbsp;&nbsp;'+list.anchor_id);
		                                       var temp = 85;
		                                       var count = list._anchor.length;
		                                       var nit_bg = $("#wifi_notif_bg");
		                                       var nit = $("#wifi_notification");
		                                       nit.height(temp*count+"px");
		                                       nit_bg.height(temp*count+"px");
		                                       var h="";
		                                       for(var i=0;i<count;i++)
		                                       {
		                                           var temp_name = '';
		                                           var temp_click = '';
		                                           var temp_img = '';
		                                           if(list._anchor[i].nickname.length!=0)
		                                           {
		                                               temp_name = '@'+list._anchor[i].nickname;
		                                               temp_click = ' onclick="weibo(\''+list._anchor[i].blogurl+'\');"';
		                                               temp_img = '<div class="dj-intro-img"></div>';
		                                           }
		                                           h+='<div '+temp_click+' class="dj-div"><div class="dj-image"><img src="'+list._anchor[i].photo+'" width="70px" style="height: 70px;" /></div><div class="dj-intro"><h3>'+temp_name+'</h3><span>'+list._anchor[i].anchor_name+'</span></div>'+temp_img+'</div>';
		                                       }
		                                      nit.html(h);
			                            }
			                        });
		       }
		       loadData(); 
		       window.setInterval(loadData(),1000*60);
		       function weibo(t)
		       {   
		           if(t.length==0)
		           {return;}
		           var localStorage = window.localStorage;
		           var notif = localStorage.getItem("notif");
		           if (!notif)
		           {
		               if(confirm("转向微博后当前播放将会中断,您确定继续吗？"))
		               {
		                   localStorage.setItem("notif", true);
		                   window.location.href=t;
		               }
		           }
		           else
		           {
		               window.location.href=t;
		           }
		       }
		       function listen_pod(pid,b_time) {
		           $.get("/hander/PlayByid.ashx", { "id": pid ,"sid":18},
			                        function (data, status) {
			                            var list = $.parseJSON(data);
			                            if (status == "success") {
			                                if (list.flag == '1') {
			                                    loadData();
			                                    var b = $("#jp_audio_0")[0];
			                                    b.pause();
			                                    if (browser.versions.iPhone) {
			                                        var pa = $("#playinfo")[0];
			                                        initClick(0);
			                                    }
			                                    else {
			                                        var pa = $("#flash")[0];
			                                        pa.mplay();
			                                        initClick(1);
			                                    }
			                                    $("#show_list").click();
			                                    return;
			                                }
			                                var play_name = $("#item_title");
			                                var play_time = $("#item_author");
			                                play_name.html(list.play_name);
			                                play_time.html(b_time + "-" + list.etime+'   '+list.anchor_id);

			                                var temp = 85;
		                                       if(list._anchor)
		                                       {
		                                           var count = list._anchor.length;
			                                    var nit_bg = $("#wifi_notif_bg");
			                                    var nit = $("#wifi_notification");
			                                    nit.height(temp * count + "px");
			                                    nit_bg.height(temp * count + "px");
			                                    var h = "";
			                                    for (var i = 0; i < count; i++) {
		                                               var temp_name = '';
		                                               var temp_click = '';
		                                               var temp_img = '';
		                                               if(list._anchor[i].nickname.length!=0)
		                                               {
		                                                   temp_name = '@'+list._anchor[i].nickname;
		                                                   temp_click = ' onclick="weibo(\''+list._anchor[i].blogurl+'\');"';
		                                                   temp_img = '<div class="dj-intro-img"></div>';
		                                               }
			                                        h+='<div '+ temp_click+' class="dj-div"><div class="dj-image"><img src="'+list._anchor[i].photo+'" width="70px" style="height: 70px;" /></div><div class="dj-intro"><h3>'+temp_name+'</h3><span>'+list._anchor[i].anchor_name+'</span></div>'+temp_img+'</div>';
			                                    }
			                                    nit.html(h);
		                                       }
		                                       else
		                                       {
		                                           $("#wifi_notification").html("");
		                                           $("#wifi_notif_bg").height(0);
		                                       }
			                                var b = $("#jp_audio_0")[0];
			                                $("#jp_audio_0").attr("src", list.url);
			                                initClick(-1);
			                                if (browser.versions.iPhone) {
			                                    var pa = $("#playinfo")[0];
			                                    pa.pause();
			                                }
			                                else {
			                                    var pa = $("#flash")[0];
			                                    pa.mstop();
			                                }
			                                b.pause();
			                                $("#radio_play").show();
			                                $("#radio_stop").hide();
			                                $("#show_list").click();
			                            }
			                        });
			                    } */

		/*  $(document).ready(function(){
		          if(!browser.versions.iPhone)
		          {
		            if(!navigator.plugins["Shockwave Flash"])
		            {
		                if(confirm("抱歉，亲~ 您还木有安装Flash播放器，点击确定后自动去下载哦！"))
		                {
		                    window.location.href="http://cdn.market.hiapk.com/data/upload//2013/03_13/10/com.adobe.flashplayer_102808.apk";   
		                }
		            }
		          }
		}); */
	</script>
</body>
</html>
